#ifndef _NVIC_H
#define _NVIC_H
#include "stm32f10x_iwdg.h"
#include "stm32f10x_dbgmcu.h"
#include "stm32f10x_exti.h"
#include "stm32f10x_gpio.h"
#include "stm32f10x_rcc.h"
#include "misc.h"


#define GD0IRQ                     GPIO_Pin_10
#define GD0IRQ_GPIO                GPIOB

#define GD0IRQ_EXTI                EXTI_Line10
#define GD0IRQ_EXTI_PORT           GPIO_PortSourceGPIOB
#define GD0IRQ_EXTI_PIN            GPIO_PinSource10
#define GD0IRQ_EXTI_IRQn           EXTI15_10_IRQn
#define GD0IRQ_EXTI_USEIRQ         ENABLE
#define GD0IRQ_EXTI_NOIRQ          DISABLE


//#define RUN_ENABLE_IWDG
#define RUN_LSI_FREQ		40000		    // 40 KHz LSI for IWDG


int CC1101_ISR_Configuration(void);

int NVIC_CC1101GD0(FunctionalState state);

int Is_CCxxx0_IRQ_enabled(void);

void NVIC_Configuration(void);

uint16_t runIWDGInit(int ms);

void runFeedIWDG(void);

#endif
